//
//  UIImage+CLExtension.h
//
//  Created by danal on 3/2/12.
//  Copyright (c) 2012 . All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (CLExtension)

/// 画纯色图
+ (UIImage*)imageWithGraphics:(UIColor*)color size:(CGSize)size;

/// 画纯色图 w:1 h:1 长宽各1像素
+ (UIImage*)imageWithGraphics:(UIColor*)color;

/// 画纯色图
+ (UIImage*)imageWithHexColor:(UIColor*)color size:(CGSize)size;

/// 画纯色图 w:1 h:1 长宽各1像素
+ (UIImage*)imageWithHexColor:(NSInteger)hexValue;

/// 剪切image
- (UIImage *)clipsToRect:(CGRect)rect;

///  image缩放 newSize
- (UIImage *)resizeToSize:(CGSize)newSize;

/// image长宽等比缩放 newSize
- (UIImage *)scaleToSize:(CGSize)newSize;

/// image 比例缩放
- (UIImage *)scaleByFactor:(float)scaleBy;

- (UIImage *)resizableImageWithLeftCap:(CGFloat)dx topCap:(CGFloat)dy width:(CGFloat)w height:(CGFloat)h;

/// image旋转
- (UIImage *)imageRotate:(long double)rotate;

/// x翻转
- (UIImage *)flipX;

/// png格式转换为jpg格式
- (UIImage *)PNG2JPG;

/// Always draw the original image, without treating it as a template.
- (UIImage *)renderOriginal;

/*
 * Filtering
 */
- (UIImage *)sepia;
- (UIImage *)grayscale;
- (UIImage *)negative;

@end
